Skip to content

Conversation

@kylosus
Copy link

@kylosus kylosus commented Jan 2, 2026

Hello. Currently the build fails if /usr/local/cuda doesn't exist in the system, even if -DCUDA_HOME is set. It seems to be due to improper handling of cmake options, as cmake args from the main project aren't visible/properly passed along to nvshmem_device_project, so it ends up always defaulting to /usr/local/cuda. Moreover, NVSHMEM_DEVICELIB_CUDA_HOME is defined and set in both NVSHMEMEnv.cmake and src/device/CMakeLists.txt - I don't think this was intentional.

This PR makes the following changes:

  • CUDAToolkit_Root is now passed from the main proj to nvshmem_device_project as CUDA_HOME
  • CUDA_HOME and NVSHMEM_DEVICELIB_CUDA_HOME are used as regular args instead of env args in nvshmem_device_project
  • Removed duplicate DEVICELIB handling from NVSHMEMEnv.cmake. Left a default option with empty path so it's visible at configure time.

Tested with cmake -B ... -DCUDA_HOME=... and CUDA_HOME cmake -B ...

- Passing CUDAToolkit_Root from main proj to nvshmem_device_project
- Removed duplicated DEVICELIB handling from NVSHMEMEnv.cmake
- Using actual cmake args instead of ENV variables in devicelib external
  project
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant